﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Singleton
{
    public class MyClass : Singleton<MyClass>
    {
        public int Value { get; set; }
       
    }

    class Program
    {
        static void Main(string[] args)
        {
            var singleton1 = Singleton.Instance;
            singleton1.Value = 10;

            var singleton2 = Singleton.Instance;
            Console.WriteLine("Singleton value = " + singleton2.Value);
            Console.ReadKey();

            var singletonGeneric1 = MyClass.Instance;
            singletonGeneric1.Value = 50;

            var singletonGeneric2 = MyClass.Instance;
            Console.WriteLine("Singleton value = " + singletonGeneric2.Value);
            Console.ReadKey();
        }
    }
}
